<?php
	$array_personas = array();

	// Si esta Activo
	if($person['Stateperson']['id'] == 1){

		$array_personas['id'] = $person['Person']['id'];
		$array_personas['fname'] = $person['Person']['full_name'];
		$array_personas['e'] = $person['Person']['email'];
		$array_personas['tel'] = $person['Person']['telefono'];
		$array_personas['nd'] = $person['Person']['nro_documento'];
		$array_personas['fn'] = date('d/m/Y', strtotime($person['Person']['fecha_nacimiento']));
		$array_personas['dir'] = $person['Person']['direccion'];
		$array_personas['loc'] = $person['Person']['localidad'];
		$array_personas['prov'] = $person['Person']['provincia'];
		$array_personas['gen'] = $person['Gender']['name'];
		$array_personas['sex'] = $person['Sex']['name'];
		$array_personas['td'] = $person['Typodocument']['name'];
		$array_personas['gs'] = $person['Gruposanguineo']['name'];
		$array_personas['edad'] = $edad['edad']." ".$edad['unidad_edad'];


		$array_personas['ooss'] = "";

		// Muestro las OOSS del Paciente
		if(!empty($ooss_paciente)){
			foreach($ooss_paciente AS $registro_ooss){
				$array_personas['ooss'] .= '<span class="etiquetas_tags fdo_celeste"><b>'.$registro_ooss['ooss'].'</b> '.$registro_ooss['plan'].' '.$registro_ooss['afiliado'].'</span>';
			}		
		}

		$array_personas['tags'] = "";

		// Muestro los TAGS si existen
		if(!empty($tags_paciente)){
			foreach($tags_paciente as $tag){
				$array_personas['tags'] .= '<span class="etiquetas_tags fdo_rojo">'.$tag['Problem']['name'].'&nbsp;</span>';
			}
		}
	}

	echo "hcejson(".json_encode($array_personas).")";
?>	